/*
 * JsonNumber.h
 *
 *  Created on: Jun 12, 2011
 *      Author: ToanNhan
 */

#ifndef JSONNUMBER_H_
#define JSONNUMBER_H_

#include "FBase.h"
#include "JsonValue.h"

using namespace Osp::Base;

class JsonNumber : public JsonValue {
private:

	ByteBuffer *m_value;
public:
	static bool isNumberElement(byte &c);
public:
	JsonNumber* cloneN();
	String toJsonString();
public:

	JsonNumber(ByteBuffer *value){
		m_value = new ByteBuffer();
		m_value->Construct(*value);
	}
	JsonNumber(const JsonNumber &jsonNumber){
		m_value = new ByteBuffer();
		m_value->Construct(*jsonNumber.m_value);
	}

	JsonNumber& operator =(JsonNumber &jsonNumber);

	ByteBuffer* getValueN();

	void setValue(String value);
	void setValue(ByteBuffer *value);

	JsonNumber();
	virtual ~JsonNumber();
};

#endif /* JSONNUMBER_H_ */
